<template>
	<!-- 订单卡片 -->
	<view class="sh-order-box u-m-b-10 u-p-r-20">
		<view class="dd">
			<view class="wd">我的订单</view>
			<view class="wr"  @tap="jump('/pages/order/list', { type: 'all' })">
				<view>全部订单</view>
				<image src="../../../static/images/fhs.png"></image>
				
			</view>
		</view>
		<view class="san">
			<view class="mm" @tap="jump('/pages/order/list', { type: order.type })" v-for="order in orderNav" :key="order.id">
				<!-- <image class="order-img" :src="$IMG_URL + order.img" mode=""></image> -->
					<view class="badge" v-if="orderNum && orderNum[order.type]">{{ orderNum[order.type] }}</view>
				<!-- <view class="badge" v-if="order.id==1">22</view> -->
					<view class="badges" v-else>22</view>
				<view class="nn">
					<image  class="order-img" :src="order.img"></image>
					<view class="item-title">{{ order.title }}</view>
				</view>
				 
								
					
			
			</view>
		</view>
		<!-- <view class="order-box u-flex"> -->
			<!-- <view class="order-item" @tap="jump('/pages/order/list', { type: order.type })" v-for="order in orderNav" :key="order.id">
				<view class="u-flex-col item-box u-col-center">
					
					 <image  class="order-img" :src="order.img"></image>
					<text class="item-title">{{ order.title }}</text>
				
				    
					<view class="badge" v-if="orderNum && orderNum[order.type]">{{ orderNum[order.type] }}</view>
				</view>
			</view> -->
			<!-- <view class="order-item u-flex-col " @tap="jump('/pages/order/after-sale/list')">
				<view class="u-flex-col item-box u-col-center">
					<image class="order-img" :src="$IMG_URL + '/imgs/user/tab55.png'" mode=""></image>
					<text class="item-title">退换货</text>
				</view>
			</view> -->
		<!-- </view> -->

		<!-- <view class="order-item u-flex-col all-order " @tap="jump('/pages/order/list', { type: 'all' })">
			<image class="cut-off--line" :src="$IMG_URL + '/imgs/user/cut_off_line.png'" mode=""></image>
			<view class="u-flex-col item-box u-col-center">
				<image class="order-img" :src="$IMG_URL + '/imgs/user/all_order.png'" mode="aspectFill"></image>
				<text class="item-title">全部订单</text>
			</view>
		</view> -->
	</view>
</template>

<script>
/**
 * 订单中心卡片
 *
 */
import { mapMutations, mapActions, mapState, mapGetters } from 'vuex';
export default {
	components: {},
	data() {
		return {
			orderNav: [
				{
					id: 1,
					title: '待处理',
					img: '../../../static/images/diadiafss.png',
					type: 'nopay'
				},
				// {
				// 	id: 2,
				// 	title: '待发货',
				// 	img: this.$IMG_URL + '/imgs/user/tab22.png',
				// 	type: 'nosend'
				// },
				{
					id: 3,
					title: '处理中',
					img: '../../../static/images/chuchuliss.png',
					type: 'noget'
				},
				{
					id: 4,
					title: '已完成',
					img: '../../../static/images/pingjiaa.png',
					type: 'nocomment'
				}
				// {
				// 	id: 5,
				// 	title: '退换货',
				// 	img: this.$IMG_URL + '/imgs/user/tab55.png',
				// 	type: 'aftersale'
				// }
			]
		};
	},
	computed: {
		...mapGetters(['isLogin', 'userOtherData']),
		orderNum() {
			return this.userOtherData.order_num || 0;
		}
	},
	methods: {
		jump(path, query) {
			this.$Router.push({
				path: path,
				query: query
			});
		}
	}
};
</script>

<style lang="scss">
.badge {
	position: relative;
	/* #ifndef APP-NVUE */
	display: inline-flex;
	/* #endif */
	justify-content: center;
	align-items: center;
	// line-height: 24rpx;
	padding: 4rpx 10rpx;
	border-radius: 100rpx;
	color: #fff;
	font-size: 26rpx;
	z-index: 9;
	background-color: $u-type-error;
	transform: scale(0.8);
	transform-origin: center center;
	left: 50rpx;
	top: -16rpx;
	white-space: nowrap;
}
.badges{
	position: relative;
	/* #ifndef APP-NVUE */
	display: inline-flex;
	/* #endif */
	justify-content: center;
	align-items: center;
	// line-height: 24rpx;
	padding: 4rpx 10rpx;
	border-radius: 100rpx;
	color: #fff;
	// font-size: 26rpx;
	// z-index: 9;
	// background-color: $u-type-error;
	// transform: scale(0.8);
	transform-origin: center center;
	left: 50rpx;
	top: -16rpx;
	white-space: nowrap;
}
// 订单卡片
.sh-order-box {
	height: 240rpx;
	background: #fff;
	.order-box {
		flex: 3;
	}
	.all-order {
		position: relative;
		.cut-off--line {
			position: absolute;
			top: 50%;
			transform: translateY(-50%);
			right: (750rpx/5) - 15rpx;
			width: 30rpx;
			height: 136rpx;
		}
	}

	.order-item {
		// width: 100%;
		flex: 1;
		// display: flex;
		// justify-content: space-between;
		
		
		.item-box {
			// width: 255rpx;
			// position: relative;
		}
		.order-img {
			width: 46rpx;
			height: 46rpx;
		}

		.item-title {
			font-size: 26rpx;
			font-weight: 500;
			// color: rgba(153, 153, 153, 1);
			color: #333;
			line-height: 24rpx;
			margin-top: 20rpx;
		}
	}
}
.dd{
	padding: 30rpx 40rpx;
	
	display: flex;
	align-items: center;
	justify-content: space-between;
	.wd{
		// margin-left: 30rpx;
		font-size: 26rpx;
		font-family: Microsoft YaHei-Regular, Microsoft YaHei;
		font-weight: 400;
		color: #333333;
	}
	.wr{
		margin-right: -20rpx;
		font-size: 26rpx;
		color: #999999;
		display: flex;
		align-items: center;
		image{
			width: 24rpx;
			height: 24rpx;
		}
		
	}
}
.san{
	display: flex;
	align-items: center;
	padding: 0rpx 40rpx;
	justify-content: space-between;
	.mm{
		text-align: center;
		// display: flex;
		// align-items: center;
		.order-img {
			width: 46rpx;
			height: 46rpx;
		}
		
		.item-title {
			font-size: 26rpx;
			font-weight: 500;
			// color: rgba(153, 153, 153, 1);
			color: #333;
			line-height: 24rpx;
			margin-top: 20rpx;
		}
	}
}
.nn{
	margin-top: -20rpx;
}
</style>
